#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void* my_memmove(void* dest, const void* src, size_t num)
{
	void* ret = dest;
	if (dest < src)
	{
		while (num--)
		{
			*(char*)dest = *(char*)src;
			dest = (char*)dest + 1;
			src = (char*)src + 1;

		}
	}
	else
	{
		dest = (char*)dest + num - 1;
		src = (char*)src + num - 1;

		while (num--)
		{
			*(char*)dest = *(char*)src;
			dest = (char*)dest - 1;
			src = (char*)src - 1;
		}
	}
}
int main()
{
	char arr[200] = "lyz like fzy!";
	my_memmove(arr + 9, arr, 3);
	printf("%s\n",arr);
	return 0;
}
//#include <stdio.h>
//#include <string.h>
//int main()
//{
//	int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
//	memmove(arr1 + 2, arr1, 20);
//	int i = 0;
//	for (i = 0; i < 10; i++)
//	{
//		printf("%d ", arr1[i]);
//	}
//	return 0;
//}
